import {HttpException,HttpStatus,ExceptionFilter, Catch,ArgumentsHost} from '@nestjs/common'

export class BaseError extends HttpException{
    private readonly code:number
    private readonly data:any

    constructor(code:number,message?:string,data?:any){
        super(message,HttpStatus.OK)
        this.code = code;
        this.data = data;
    }
    
    getResponse():object{
        return {code:this.code,message:this.message,data:this.data}
    }
}